#include <cstdio>
#include <string>
#include <map>
#include <iterator>
#include <iostream>
using namespace std;

int n;
char ss[10002];
map<string, int> record;
map<string, int>::iterator pos;

int main()
{
	string tmp;
	int i, len;

	//freopen("3.in", "r", stdin);

	while (scanf("%d", &n)!=EOF)
	{
		while (1)
		{
			scanf("%[^a-zA-Z]", ss);
			scanf("%[a-zA-Z]", ss);
			len = strlen(ss);
			for (i=0; i<len; ++i)
				ss[i] = tolower(ss[i]);
			if (strcmp(ss, "endoftext")==0) break;
			tmp = ss;
			record[tmp]++;
		}
		bool findone = false;
		for (pos=record.begin(); pos!=record.end(); ++pos)
			if (pos->second == n)
			{
				findone = true;
				cout << pos->first << endl;
			}
		if (!findone) cout <<"There is no such word." << endl;
		cout << endl;
		record.clear();
	}

	return 0;
}